﻿using System;

namespace Kernelx.Contexts.Defaults
{
    /// <summary>
    /// 定义类型之间的映射转换关系,有默认实现,可重实现
    /// 
    /// </summary>
    public interface IMapper
    {
        /// <summary>
        ///  
        /// </summary>
        /// <typeparam name="TS"></typeparam>
        /// <typeparam name="TT"></typeparam> 
        /// <param name="source"></param>
        /// <param name="target"></param>
        /// <param name="skipEmpty"> <paramref name="source"/>的空值属性是否跳过赋值操作,默认不跳过</param>
        /// <param name="ignoreProps">返回TT类型中需要忽略赋值的属性集对象</param>
        /// <returns></returns>
        TT MapTo<TS, TT>(TS source, TT target, bool skipEmpty = false, Func<TT, object> ignoreProps = null)
            where TS : class
            where TT : class;

    }
}